﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="vote_edit.aspx.cs" Inherits="EazyCMS.Web.Plugin.Vote.admin.vote_edit" ValidateRequest="false" %>
<%@ Import namespace="EazyCMS.Common" %>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>编辑在线投票</title>
<link href="../../../scripts/artdialog/ui-dialog.css" rel="stylesheet" type="text/css" />
<link href="../../../<%=siteConfig.webmanagepath %>/skin/default/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="../../../scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../scripts/jquery/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../scripts/datepicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../editor/kindeditor-min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../<%=siteConfig.webmanagepath %>/js/laymain.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../<%=siteConfig.webmanagepath %>/js/common.js"></script>
<script type="text/javascript">
    $(function () {
        //初始化表单验证
        $("#form1").initValidform();

        //初始化编辑器
        var editor = KindEditor.create('.editor', {
            width: '100%',
            height: '250px',
            filterMode: false, //默认不过滤HTML
            resizeType: 1,
            uploadJson: '../../../tools/upload_ajax.ashx?action=EditorFile&IsWater=1',
            fileManagerJson: '../../../tools/upload_ajax.ashx?action=ManagerFile',
            allowFileManager: true
        });

        //添加按钮(点击绑定)
        $("#itemAddButton").click(function () {
            addItemTr();
        });
    });
    //创建窗口
    function addItemTr() {
        var trHtml = '<tr class="td_c">'
        + '<td><input type="hidden" name="item_id" value="0" />'
        + '<input name="item_title" type="text" value="" class="td-input" style="width:98%;" /></td>'
        + '<td><input name="item_num" type="text" size="8" value="0" class="td-input" /></td>'
        + '<td><input name="item_sortid" type="text" size="8" value="99" class="td-input" /></td>'
        + '<td><a title="删除" class="img-btn del operator" onclick="delItemTr(this);">删除</a></td>'
        + '</tr>';
        $("#item_box").append(trHtml);
    }
    //删除节点
    function delItemTr(obj) {
        $(obj).parent().parent().remove();
    }
</script>
</head>

<body class="mainbody">
<form id="form1" runat="server">
<!--导航栏-->
<div class="location">
  <a href="index.aspx" class="back"><i></i><span>返回列表页</span></a>
  <a href="../../../<%=siteConfig.webmanagepath %>/center.aspx" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <span>插件管理</span>
  <i class="arrow"></i>
  <span>在线投票</span>
  <i class="arrow"></i>
  <span>编辑投票</span>
</div>
<div class="line10"></div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">编辑投票内容</a></li>
      </ul>
    </div>
  </div>
</div>

<div class="tab-content">
  <dl>
    <dt>所属站点</dt>
    <dd>
      <div class="rule-single-select">
        <asp:DropDownList id="ddlSitePath" runat="server" datatype="*" errormsg="请选择所属站点！" sucmsg=" "></asp:DropDownList>
      </div>
    </dd>
  </dl>
   <%-- <dl>
    <dt>所属专题</dt>
    <dd>
      <div class="rule-single-select">
        <asp:DropDownList id="ddspecial" runat="server" datatype="*" errormsg="请选择所属专题！" sucmsg=" "></asp:DropDownList>
      </div>
    </dd>
  </dl>--%>
  <dl>
    <dt>排序数字</dt>
    <dd>
      <asp:TextBox ID="txtSortId" runat="server" CssClass="input small" datatype="n" sucmsg=" ">99</asp:TextBox>
      <span class="Validform_checktip">*数字，越小越向前</span>
    </dd>
  </dl>
  <dl>
    <dt>投票类型</dt>
    <dd>
      <div class="rule-multi-radio">
        <asp:RadioButtonList ID="rblIsMulti" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
        <asp:ListItem Value="0" Selected="True">单选</asp:ListItem>
        <asp:ListItem Value="1">多选</asp:ListItem>
        </asp:RadioButtonList>
      </div>
    </dd>
  </dl>
  <dl>
    <dt>开始时间</dt>
    <dd>
      <asp:TextBox ID="txtStartTime" runat="server" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="/^\d{4}\-\d{1,2}\-\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " />
      <span class="Validform_checktip">*当前时间大于该时间允许投票</span>
    </dd>
  </dl>
  <dl>
    <dt>结束时间</dt>
    <dd>
      <asp:TextBox ID="txtEndTime" runat="server" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="/^\d{4}\-\d{1,2}\-\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " />
      <span class="Validform_checktip">*过期不允许投票</span>
    </dd>
  </dl>
  <dl>
    <dt>调查主题</dt>
    <dd><asp:TextBox ID="txtTitle" runat="server" CssClass="input normal" datatype="*2-100" sucmsg=" "></asp:TextBox></dd>
  </dl>
    <dl>
    <dt>题目</dt>
    <dd><asp:TextBox ID="txtTimu" runat="server" CssClass="input normal" datatype="*2-100" sucmsg=" "></asp:TextBox></dd>
  </dl>
  <dl>
    <dt>选项</dt>
    <dd><a id="itemAddButton" class="icon-btn add"><i></i><span>添加选项</span></a></dd>
  </dl>
    <dl>
    <dt></dt>
    <dd>
      <div class="table-container">
        <table border="0" cellspacing="0" cellpadding="0" class="border-table" width="98%">
          <thead>
              <tr>
                <th style="text-align:left">选项内容</th>
                <th width="80">票数</th>
                <th width="80">排序</th>
                <th width="50">操作</th>
              </tr>
            </thead>
            <tbody id="item_box">
              <asp:Repeater ID="rptList" runat="server">
              <ItemTemplate>
              <tr class="td_c">
                <td>
                  <input type="hidden" name="item_id" value="<%#Eval("id")%>" />
                  <input name="item_title" type="text" value="<%#Eval("title")%>" class="td-input" style="width:98%;" />
                </td>
                <td>
                  <input name="item_num" type="text" size="8" value="<%#Eval("vote_num")%>" class="td-input" />
                </td>
                <td>
                  <input name="item_sortid" type="text" size="8" value="<%#Eval("sort_id")%>" class="td-input" />
                </td>
                <td>
                  <a title="删除" class="img-btn del operator" onclick="delItemTr(this);">删除</a>
                </td>
              </tr>
              </ItemTemplate>
              </asp:Repeater>
            </tbody>
        </table>
      </div>
    </dd>
  </dl>
  <dl>
    <dt>内容介绍</dt>
    <dd>
      <textarea id="txtContent" class="editor" style="visibility:hidden;" runat="server"></textarea>
    </dd>
  </dl>
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
    <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" onclick="btnSubmit_Click" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
  </div>
</div>
<!--/工具栏-->
</form>
</body>
</html>
